/*
 * 文 件    名:  SearchHistoryModel.java
 * 创建日期:  2012-10-11上午11:23:55
 * 版          权:  Epro Technologies Co., Ltd. Copyright 2011-2012,  All rights reserved
 * 作          者:  cl073
 */
package com.weipu.common.facade.content.model;

import java.io.Serializable;

import android.content.ContentValues;
import android.database.Cursor;

import com.weipu.common.facade.content.colum.SearchHistoryColumn;

/** 
 * @Description 本地搜索历史记录model
 * @version [版本号, 2012-10-11]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 * 
 * @author cl073
 */
public class SearchHistoryModel implements Serializable
{
    
    /**
     * 注释内容
     */
    private static final long serialVersionUID = -7723358660145049116L;
    
    /**
     * id
     */
    private Integer id;
    
    /**
     * SearchHistory id
     */
    private Integer searchhistoryid;
    
    /**
     * 搜索历史名
     */
    private String name;
    
    private long searchTime;
    
    public long getSearchTime() {
		return searchTime;
	}

	public void setSearchTime(long searchTime) {
		this.searchTime = searchTime;
	}

	public Integer getId()
    {
        return id;
    }
    
    public void setId(Integer id)
    {
        this.id = id;
    }
    
    public Integer getSearchHistoryId()
    {
        return searchhistoryid;
    }
    
    public void setSearchHistoryId(Integer searchhistoryid)
    {
        this.searchhistoryid = searchhistoryid;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    public SearchHistoryModel()
    {
        
    }
    
    public SearchHistoryModel(Cursor cursor)
    {
        if (null == cursor || cursor.getCount() < 1)
        {
            return;
        }
        setSearchHistoryId(cursor.getInt(1));
        setName(cursor.getString(2));
    }
    
    /**
      * 对象转换为map
      * @return  [参数说明]
      * @return ContentValues [返回类型说明]
      * @exception throws [违例类型] [违例说明]
      * @see [类、类#方法、类#成员]
      */
    public ContentValues template2map()
    {
        ContentValues map = new ContentValues();
        if (null != name)
        {
            map.put(SearchHistoryColumn.HISTORYNAME, name);
            map.put(SearchHistoryColumn.SEARCH_HISTORY_TIME, searchTime);
        }
        return map;
        
    }
    //    
    
}
